from django.db import models

"""
活动分类
"""
class ActivityCategroy(models.Model):

     title = models.CharField(max_length=10,verbose_name="分类名称")
     url = models.CharField(max_length=100, verbose_name="链接地址")
     categoryId = models.CharField(max_length=10,verbose_name="分类ID",primary_key=True)

     class Meta:
         verbose_name = "活动分类"
         verbose_name_plural = verbose_name

     def __str__(self):
         return self.name

"""
食材分类
"""
class MaterialCategroy(models.Model):

     name = models.CharField(max_length=10,verbose_name="分类名称")
     url = models.CharField(max_length=100, verbose_name="链接地址")
     foodId = models.CharField(max_length=10,verbose_name="分类ID",primary_key=True)
     prentFoodId = models.CharField(max_length=10, verbose_name="父类ID")

     class Meta:
         verbose_name = "食材分类"
         verbose_name_plural = verbose_name

     def __str__(self):
         return self.name

"""
菜谱
"""
class Foods(models.Model):

    id = models.AutoField(primary_key=True)
    foodId = models.CharField(max_length=10,verbose_name="分类ID")
    name = models.CharField(max_length=50,null=True,verbose_name="菜谱名称")
    img = models.CharField(max_length=100,null=True,verbose_name="图片链接")
    material = models.CharField(max_length=100,verbose_name="食材")
    foodDetailurl = models.CharField(max_length=100,null=True, verbose_name="详情地址")
    number = models.CharField(max_length=11,null=True,verbose_name="人数")
    author = models.CharField(max_length=50,null=True,verbose_name="作者")

    class Meta:
        verbose_name = "菜谱"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name